Skip to content

ignore events relays send that weren't asked for - #21

Merged
tinfoilhash merged 1 commit into
developmentfrom
ignore-unrequested-events
Nov 12, 2026
Merged

tinfoilhash merged 1 commit into
developmentfrom
ignore-unrequested-events

Conversation

@tinfoilhash

Copy link
Copy Markdown
Owner

a relay could answer a lookup with a verification of a different file, or any other signed event, and the cli would list it as verifying this one. a malicious or compromised file relay could use that to show a bad file as verified by someone you follow. the web app isn't affected: its relay pool (nostr-tools) drops events that don't match the subscription's filters.

the cli now does the same. every client comes from relay_connector::build_client(), which turns on nostr-sdk's verify_subscriptions. that covers the verification lookup, the profile fetched before publishing, and the "already verified?" check, which a relay could otherwise fool into skipping a publish.

the new tests use nostr-sdk's mock relay in a mode that answers every request with random text notes. both fail without the fix.

made with claude code + tinfoil hash · session cac618d4-34cf-4f09-bff6-b4a25528953f

a relay could answer a lookup with a verification of a different file,
or any other signed event, and it would be listed as verifying this
one. like the web page, whose relay pool drops events that don't match
the subscription's filters, every client now has nostr-sdk check that
each event matches what was asked for.

> made with claude code + tinfoil hash · session `cac618d4-34cf-4f09-bff6-b4a25528953f`

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@tinfoilhash
tinfoilhash merged commit 7475ce9 into development Nov 12, 2026
1 check passed
@tinfoilhash
tinfoilhash deleted the ignore-unrequested-events branch November 12, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant